package org.fluidripple.common;

import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.ResponseBody;

@ControllerAdvice
@Slf4j
public class GlobalAdviceException {

    /**
     * 统一异常处理
     */
    @ResponseBody
    @ExceptionHandler(value = Exception.class)
    public Result<String> handlerException(Exception e) {
        e.printStackTrace();
        return Result.error(e.getMessage());
    }
}
